home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.43 / flushcx / source / flush_4_shell.p < prev    next >
Text File  |  1995-01-07  |  1KB  |  56 lines

  1.  
  2. { FlushCX for Shell...
  3.  
  4.   © by J. Stötzer. All rights reserved, look into docu for more info  }
  5.  
  6.  
  7. Program FlushCX;
  8.  
  9. uses Exec,ExecSupport;
  10.  
  11. {$incl "commodities.lib"}
  12.  
  13. type p_BrokerCopy = ^BrokerCopy;
  14.      BrokerCopy = record
  15.                     bc_Node : Node;
  16.                     bc_Name : string[CBD_NAMELEN];
  17.                     bc_Title: string[CBD_TITLELEN];
  18.                     bc_Descr: string[CBD_DESCRLEN];
  19.                     bc_Task,bc_Dummy1,bc_Dummy2 : long;
  20.                     bc_Flags: word;
  21.                   end;
  22.  
  23. var BList : p_List;
  24.     CNode : p_Node;
  25.     HNode : p_BrokerCopy;
  26.     ok    : long;
  27.  
  28. begin
  29.  
  30.   CXBase:=OpenLibrary("commodities.library",37);
  31.   if CXBase=Nil then
  32.     writeln("Can`t open commodities.library")
  33.   else begin
  34.     BList:=ptr(AllocVec(SizeOf(List),MEMF_PUBLIC));
  35.     if BList=Nil then
  36.       writeln("No memory for brokerlist")
  37.     else begin
  38.       NewList(BList);
  39.       ok:=CopyBrokerList(BList);
  40.       CNode:=BList^.lh_Head;
  41.       repeat
  42.         HNode:=p_BrokerCopy(ptr(CNode));
  43.         BrokerCommand(HNode^.bc_Name,CXCMD_KILL);
  44.         CNode:=CNode^.ln_Succ;
  45.       until CNode=Nil;
  46.       ok:=FreeBrokerList(BList);
  47.       FreeVec(BList);
  48.     end;
  49.     CloseLibrary(CXBase);
  50.   end;
  51.  
  52. end.
  53.  
  54.  
  55.  
  56.